<template>
	<view class="header-nav w-100prec center">
		<view class="header-inner-cont main-area-width  center flex-row p-10">
			<view class="logo dark">
				<!-- css 渲染 logo -->
				S<text class="font-mini">am9029</text>Manga
			</view>
			<view v-if="props.searchShow" class="user-operation-area light flex-row">
				
				<u-search 
					placeholder="日照香炉生紫烟" 
					v-model="keyword"
					:show-action="false"
					@search='handleSearch'
					></u-search>
				
				<!-- 留给 PC -->
				<!-- 登录、注册 -->
				<!-- 个人信息 -->
				<!-- <view v-if="true" class="login-cont">
					<text class="cursor-pointer">登录</text>
					<text class="p-10">|</text>
					<text class="cursor-pointer">注册</text>
				</view>
				<view v-else class="user-profile">
					<text>头像</text>
					<text>信息</text>
				</view> -->
			</view>
		</view>
	</view>
</template>

<script setup>
	import {ref} from 'vue';
	
	let props = defineProps({
		searchShow:{
			type:Boolean,
			default:false
		}
	})
	
	let keyword = ref("")
	
	// _val接受 搜索组件的 传入值
	let handleSearch = (_val)=>{
		console.log(_val)
	}
</script>

<style lang="scss" scoped>
	@import '../assets/style/common.scss';
	.font-mini{
		font-size:10px;
	}
	.header-nav {
		// margin-bottom: 15px;
		background-color: $u-primary;

		.header-inner-cont {
			width: 100%;
			height: 40px;

			.logo {
				text-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
			}
			
			.user-operation-area{
				
				.login-cont{
					font-size: 14px;
				}
			}
		}
	}
</style>
